﻿namespace BomComparison.Core.Model;

public enum PartNumberChangeType
{
    Unchanged, // 未变更
    Modified,  // 修改（位号变化）
    Added,     // 新增
    Deleted,   // 删除
    Replaced   // 替代（相同位号，不同料号）
}

public class ComparisonResultByPartNumber
{
    public PartNumberChangeType ChangeType { get; set; } // 添加 PartNumberChangeType 属性

    public BomItem OldBomItem { get; set; }
    public BomItem NewBomItem { get; set; }
    public PartReferenceDiff ChangedReferences { get; set; } = new(); // 变更的位号集合

    public ComparisonResultByPartNumber()
    {
    }

    // Private constructor to enforce using the builder
    public ComparisonResultByPartNumber(BomItem oldItem, BomItem newItem, PartReferenceDiff changes, PartNumberChangeType changeType)
    {
        OldBomItem = oldItem;
        NewBomItem = newItem;
        ChangedReferences = changes;
        ChangeType = changeType; // 设置 PartNumberChangeType
    }
}
